import { userControllerGetUserInfo } from "@/app/servers/api/user";
import { cookies, headers } from "next/headers";
import dynamic from "next/dynamic";

const RecordDynamic = dynamic(() => import("./record/record"), { ssr: true });
const BasicInfoDynamic = dynamic(() => import("./basic-info/basic-info"), { ssr: true });
export default async function PersonalHomePage() {
  const reqCookies = cookies();
  const reqHeaders = headers();
  console.time();
  const { data: userInfo } = await userControllerGetUserInfo({
    next: {
      headers: reqHeaders,
      cookies: reqCookies,
    },
  });
  console.log("计算结束的时间");
  console.timeEnd();
  return (
    <div className="max-w-4xl mx-auto py-8 px-4">
      <BasicInfoDynamic userInfo={userInfo} />
      <RecordDynamic userInfo={userInfo} />
    </div>
  );
}
